package com.xxy.springcloud.controller;

import com.xxy.springcloud.entities.CommonResult;
import com.xxy.springcloud.entities.Payment;
import com.xxy.springcloud.feign.PaymentProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/consumer")
public class OrderController {

    @Resource
    PaymentProvider paymentProvider;

    @GetMapping(value = "/payment/hystrix/ok/{id}")
    public  String paymentInfo_Ok(@PathVariable Integer id){
        return paymentProvider.paymentInfo_Ok(id);
    }

    @GetMapping("/payment/hystrix/timeout/{id}")
    private String paymentInfo_TimeOut(@PathVariable Integer id) {
        return paymentProvider.paymentInfo_TimeOut(id);
    }
}

